@import "../../styles/index.scss";

$datepicker-prefic-cls: "date-picker";

$picker-base-width: 295px;

.#{$datepicker-prefic-cls}-input {
  width: 335px;
  .iconfont {
    color: $black-25;
    &.iconfont-close {
      cursor: pointer;
    }
  }
}

.#{$datepicker-prefic-cls}-wrapper {
  display: inline-block;
  &.is-disabled {
    cursor: not-allowed;
    & > * {
      pointer-events: none;
    }
  }
}

.#{$datepicker-prefic-cls} {
  display: inline-block;
  position: relative;
  width: $picker-base-width;
  padding: 20px;
  box-sizing: border-box;
  background: #fff;
  @include normalShadow();
  border-radius: 4px;
  font-size: 14px;
  &-title {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    &-content {
      flex: 1;
      text-align: center;
      color: $black-65;
      &-item {
        display: inline-block;
        text-decoration: none;
        transition: color 0.3s;
        color: $black-65;
        &:not(:last-child) {
          padding-right: 5px;
        }
        &:hover {
          color: $blue;
        }
      }
      &-time {
        display: inline-block;
        width: 100%;
        line-height: 60px;
        text-align: center;
      }
    }
    &-btn {
      cursor: pointer;
      .icon {
        transition: all 0.3s;
        &:last-child {
          margin-left: 10px;
        }
        &:hover {
          color: $blue;
        }
      }
    }
  }
  &-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 10px;
    &-button {
      font-size: 12px;
      color: $blue;
      line-height: 1.5;
      cursor: pointer;
      &:not(:last-child) {
        margin-right: 4px;
      }
    }
  }
  &-large-title {
    padding: 0 30px;
    line-height: 60px;
  }
  &-content {
    width: 100%;
    border-collapse: collapse;
    &-header {
      color: $black-65;
      line-height: 1;
      th {
        padding: 18px 0;
      }
    }
    .date {
      width: 35px;
      height: 35px;
      cursor: pointer;
      border: 1px solid $black-5;
      text-align: center;
      box-sizing: border-box;
      transition: background 0.3s;
      &:hover {
        background: colorPalette($blue, 70%);
      }
      &.is-selected {
        color: #fff;
        background: $blue;
        border-color: #fff;
        opacity: 0.9;
      }
      &.date-pre,
      &.date-after {
        opacity: 0.4;
      }
      &.is-disabled {
        opacity: 0.2;
        border-color: #fafafa;
        pointer-events: none;
      }
    }
  }
  &-panel {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background: #fff;

    &-content {
      display: flex;
      flex-wrap: wrap;
      line-height: 62px;
      &-item {
        display: inline-block;
        text-align: center;
        width: 33.33333333%;
        cursor: pointer;
        &-cell {
          padding: 5px 10px;
          transition: background 0.2s;
          &:hover {
            background: colorPalette($blue, 70%);
          }
          &.is-selected {
            color: #fff;
            background: $blue;
          }
        }
      }
    }
  }
  &.#{$datepicker-prefic-cls}-full {
    width: 100%;
  }
}
